package net.itbaiyang.pattern.notification;


import jakarta.annotation.Resource;
import net.itbaiyang.pattern.component.notification.SendMessageEvent;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UniPushService implements NotificationService{

    @Resource
    private ApplicationContext applicationContext;

    @Override
    public void pushNotification(String message) {
        // todo业务代码处理



        // 发布发送消息事件
        applicationContext.publishEvent(new SendMessageEvent(this, "userId", message, List.of("1","2","3")));
    }
}
